<?php
/*
 * Created on 18.11.2007
 *
 * filename: model_setup.php
 */

define ('GET_ALL','SELECT * FROM `setup`');
define ('SET_HEADER','update setup set header_text = ?');
define ('SET_FOOTER','update setup set footer_text = ?');
define ('SAVE_ALL_SETUPS','UPDATE `setup` SET `header_text` = ?, `footer_text` = ?, `add_condition_visibility` = ?,`add_condition_access` = ? ');
class Model_Setup extends Models_Base  {
	
	function getAll () {
		$sth = $this->dbh->prepare(GET_ALL);
		$sth->execute();
		
		return $sth->fetchObject();
	}
	
	function setHeaderText($text) {
		$sth = $this->dbh->prepare(SET_HEADER);
		$sth->execute(array($text));
	}

	function setFooterText($text) {
		$sth = $this->dbh->prepare(SET_FOOTER);
		$sth->execute(array($text));		
	}
	
	function saveAll($args) {
		$sth = $this->dbh->prepare(SAVE_ALL_SETUPS);
		$sth->execute($args);
	}	
 }
 
?>
